# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=libkdepim
pkgver=20.04.3
pkgrel=0
pkgdesc="Lib for common KDEPim apps"
arch="all !armhf"
url="https://community.kde.org/KDE_PIM"
license="GPL-2.0-or-later AND LGPL-2.0-or-later"
depends_dev="qt5-qtbase-dev kcodecs-dev kcompletion-dev kconfig-dev kconfigwidgets-dev kcoreaddons-dev ki18n-dev kiconthemes-dev kitemviews-dev kjobwidgets-dev kcmutils-dev kio-dev kwallet-dev kwidgetsaddons-dev akonadi-dev akonadi-contacts-dev akonadi-search-dev kldap-dev"
makedepends="$depends_dev extra-cmake-modules qt5-qttools-dev"
checkdepends="xvfb-run"
source="https://download.kde.org/stable/release-service/$pkgver/src/libkdepim-$pkgver.tar.xz"
subpackages="$pkgname-dev $pkgname-lang"

build() {
	cmake -B build \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_DESIGNERPLUGIN=ON
	cmake --build build
}

check() {
	cd build
	CTEST_OUTPUT_ON_FAILURE=TRUE xvfb-run ctest
}

package() {
	DESTDIR="$pkgdir" cmake --build build --target install
}
sha512sums="b1be6f143466b52342a659fd76124808354584355dbcb283ffc41b126bdbf79b4bf01028954be6be450f3634ced8748f2be4433ee0393505388f442e7393b0dc  libkdepim-20.04.3.tar.xz"
